<!doctype html>
<html lang="en-US">

<head>
  <title>Two Chat panes side-by-side using Fluent theme</title>
  <link href="/assets/index.css" rel="stylesheet" type="text/css" />
  <script type="importmap">
    {
      "imports": {
        "react": "https://esm.sh/react@18.3.1",
        "react-dom": "https://esm.sh/react-dom@18.3.1",
        "react-dom/": "https://esm.sh/react-dom@18.3.1/",
        "@fluentui/react-components": "https://esm.sh/@fluentui/react-components?deps=react@18.3.1&exports=FluentProvider,createDarkTheme"
      }
    }
  </script>
  <script crossorigin="anonymous" src="/test-harness.js"></script>
  <script crossorigin="anonymous" src="/test-page-object.js"></script>
  <script type="module">
    import React from 'react';
    window.React = React;
  </script>
  <script defer crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
  <script defer crossorigin="anonymous" src="/__dist__/botframework-webchat-fluent-theme.production.min.js"></script>

  <style>
    :root:has(.theme-provider.light) {
      --colorBrandBackground2: hsl(237, 100%, 96%);
      --colorBrandForeground1: hsl(237, 99%, 28%);
      --colorBrandForegroundLink: hsl(237, 99%, 28%);
      --colorBrandForegroundLinkHover: hsl(237, 98%, 24%);
      --colorBrandForegroundLinkPressed: hsl(237, 98%, 18%);
      --colorBrandForegroundLinkSelected: hsl(237, 99%, 28%);
      --colorCompoundBrandForeground1Hover: hsl(237, 97%, 31%);
      --colorBrandForeground2Hover: hsl(237, 36%, 42%);
      --colorBrandStroke2Hover: hsl(237, 89%, 82%);
      --colorBrandBackground2Hover: hsl(237, 75%, 92%);
      --colorBrandForeground2Pressed: hsl(237, 26%, 27%);
      --colorBrandStroke2Pressed: hsl(237, 49%, 57%);
      --colorBrandBackground2Pressed: hsl(237, 87%, 85%);
      --colorBrandStroke2: hsl(237, 53%, 68%);
      --shadow2: 0 0 2px rgba(0, 0, 0, 12%), 0 1px 2px rgba(0, 0, 0, 14%);
    }

    body:has(.theme-provider.dark) {
      /* The background is a decorative "Endless Clouds" pattern from https://www.heropatterns.com/ under CC BY 4.0. */
      background: #070707 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 28' width='56' height='28'%3E%3Cpath fill='%23111111' fill-opacity='0.4' d='M56 26v2h-7.75c2.3-1.27 4.94-2 7.75-2zm-26 2a2 2 0 1 0-4 0h-4.09A25.98 25.98 0 0 0 0 16v-2c.67 0 1.34.02 2 .07V14a2 2 0 0 0-2-2v-2a4 4 0 0 1 3.98 3.6 28.09 28.09 0 0 1 2.8-3.86A8 8 0 0 0 0 6V4a9.99 9.99 0 0 1 8.17 4.23c.94-.95 1.96-1.83 3.03-2.63A13.98 13.98 0 0 0 0 0h7.75c2 1.1 3.73 2.63 5.1 4.45 1.12-.72 2.3-1.37 3.53-1.93A20.1 20.1 0 0 0 14.28 0h2.7c.45.56.88 1.14 1.29 1.74 1.3-.48 2.63-.87 4-1.15-.11-.2-.23-.4-.36-.59H26v.07a28.4 28.4 0 0 1 4 0V0h4.09l-.37.59c1.38.28 2.72.67 4.01 1.15.4-.6.84-1.18 1.3-1.74h2.69a20.1 20.1 0 0 0-2.1 2.52c1.23.56 2.41 1.2 3.54 1.93A16.08 16.08 0 0 1 48.25 0H56c-4.58 0-8.65 2.2-11.2 5.6 1.07.8 2.09 1.68 3.03 2.63A9.99 9.99 0 0 1 56 4v2a8 8 0 0 0-6.77 3.74c1.03 1.2 1.97 2.5 2.79 3.86A4 4 0 0 1 56 10v2a2 2 0 0 0-2 2.07 28.4 28.4 0 0 1 2-.07v2c-9.2 0-17.3 4.78-21.91 12H30zM7.75 28H0v-2c2.81 0 5.46.73 7.75 2zM56 20v2c-5.6 0-10.65 2.3-14.28 6h-2.7c4.04-4.89 10.15-8 16.98-8zm-39.03 8h-2.69C10.65 24.3 5.6 22 0 22v-2c6.83 0 12.94 3.11 16.97 8zm15.01-.4a28.09 28.09 0 0 1 2.8-3.86 8 8 0 0 0-13.55 0c1.03 1.2 1.97 2.5 2.79 3.86a4 4 0 0 1 7.96 0zm14.29-11.86c1.3-.48 2.63-.87 4-1.15a25.99 25.99 0 0 0-44.55 0c1.38.28 2.72.67 4.01 1.15a21.98 21.98 0 0 1 36.54 0zm-5.43 2.71c1.13-.72 2.3-1.37 3.54-1.93a19.98 19.98 0 0 0-32.76 0c1.23.56 2.41 1.2 3.54 1.93a15.98 15.98 0 0 1 25.68 0zm-4.67 3.78c.94-.95 1.96-1.83 3.03-2.63a13.98 13.98 0 0 0-22.4 0c1.07.8 2.09 1.68 3.03 2.63a9.99 9.99 0 0 1 16.34 0z'%3E%3C/path%3E%3C/svg%3E");
    }

    #webchat {
      width: 1460px;
      height: 700px;
      box-sizing: border-box;
      background: hsla(237, 80%, 60%, 0.05);
      padding: 32px;
      display: flex;
      gap: 16px;
    }

    .theme-provider.dark {
      background: hsla(237, 80%, 60%, 0.05);
    }

    .theme-provider {
      display: contents;
    }

    .webchat-left,
    .webchat-right {
      width: 680px;
      height: 100%;
      box-sizing: border-box;
    }

    .webchat-right {
      flex: auto;
      background: hsla(0, 0%, 100%, 0.6);
      border-radius: 8px;
      box-shadow: var(--shadow2);
      padding: 14px 4px;
    }

    .theme-provider.dark .webchat-right {
      background: hsla(0, 0%, 0%, 0.6);
    }

    .webchat-left .webchat-fluent .sendbox__sendbox {
      grid-template:
        [telephone-keypad-start] "text-area controls"[attachment-bar telephone-keypad-end] / [telephone-keypad text-area attachment-bar] 5fr [controls] 1fr;
    }

    .border-loader__loader,
    .border-flair {
      animation-delay: -1s !important;
      animation-play-state: paused !important;
    }
  </style>
</head>

<body>
  <main id="webchat"></main>
  <script type="module">
    import React from 'react';
    import { flushSync } from 'react-dom';
    import { createRoot } from 'react-dom/client';
    import { FluentProvider, createDarkTheme } from '@fluentui/react-components';

    run(async function () {
      const {
        WebChat: { FluentThemeProvider, ReactWebChat },
      } = window; // Imports in UMD fashion.

      await host.sendDevToolsCommand('Emulation.setEmulatedMedia', {
        features: [{ name: 'prefers-reduced-motion', value: 'reduce' }]
      });

      await host.windowSize(1460, 700, document.getElementById('webchat'));

      let timestampStart = new Date(2020, 7, 9).getTime();
      const timestamp = () => new Date(timestampStart += 100).toISOString();

      const searchParams = new URLSearchParams(location.search);

      const [leftTranscriptIndex = 0, rightTranscriptIndex = 1] = searchParams.getAll('transcript');
      const [leftVariant = 'fluent', rightVariant = 'copilot-deprecated'] = searchParams.getAll('variant');

      const sendBoxIndexes = searchParams.getAll('focus');
      const activeFocusPresets = searchParams.getAll('focus-preset');

      const adjustStyleOptions = Object.fromEntries(['codeBlockTheme']
        .map(key => [key, searchParams.get(key)])
        .filter(([key, value]) => value));

      const botIcon = '';

      const aiMessageEntity = {
        '@context': 'https://schema.org',
        '@id': '',
        '@type': 'Message',
        keywords: ['AIGeneratedContent'],
        type: 'https://schema.org/Message',
        author: {
          '@context': 'https://schema.org',
          '@type': 'Person',
          image: botIcon,
          name: 'Onboarding Buddy',
        }
      };

      const waveSvg = `data:image/svg+xml;utf8,${encodeURIComponent(`
<svg viewBox="0 50 400 100" xmlns="http://www.w3.org/2000/svg">
  <!-- Primary Wave -->
  <path d="M0,100 C50,50 100,150 150,100 C200,50 250,150 300,100 C350,50 400,150 400,100"
        stroke="#3B82F6" fill="none" stroke-width="2" opacity="0.5"/>

  <!-- Second Harmonic -->
  <path d="M0,100 C25,75 50,125 75,100 C100,75 125,125 150,100 C175,75 200,125 225,100 C250,75 275,125 300,100 C325,75 350,125 375,100 C400,75 400,125 400,100"
        stroke="#10B981" fill="none" stroke-width="2" opacity="0.5"/>

  <!-- Combined Wave -->
  <path d="M0,100 C40,30 80,170 120,100 C160,30 200,170 240,100 C280,30 320,170 360,100 C380,65 400,135 400,100"
        stroke="#EF4444" fill="none" stroke-width="3"/>

  <!-- Grid Lines -->
  <line x1="0" y1="100" x2="400" y2="100" stroke="#CBD5E1" stroke-width="0.5" stroke-dasharray="4"/>
  <line x1="100" y1="0" x2="100" y2="200" stroke="#CBD5E1" stroke-width="0.5" stroke-dasharray="4"/>
  <line x1="200" y1="0" x2="200" y2="200" stroke="#CBD5E1" stroke-width="0.5" stroke-dasharray="4"/>
  <line x1="300" y1="0" x2="300" y2="200" stroke="#CBD5E1" stroke-width="0.5" stroke-dasharray="4"/>
</svg>`)}`;

      const transcripts = [[
        {
          timestamp: timestamp(),
          from: { role: 'bot' },
          id: '1.0',
          text: `Great! Your copilot will maintain a polite, friendly, professional, and fun while assisting team members with onboarding tasks.
Are there any topics or tasks this copilot shouldn’t help with or talk about?`,
          type: 'message'
        },
        {
          timestamp: timestamp(),
          channelData: { state: 'sent' },
          from: { role: 'user' },
          id: '1.1',
          text: 'No',
          type: 'message'
        },
        {
          timestamp: timestamp(),
          from: { role: 'bot' },
          id: '2.0',
          text: 'Is there a website or datasource that has knowledge that will be necessary for Onboarding Buddy?',
          type: 'message'
        },
        {
          timestamp: timestamp(),
          channelData: { state: 'sent' },
          from: { role: 'user' },
          id: '2.1',
          text: 'https://sharepoint.contoso.com/newhires/',
          type: 'message'
        },
        {
          timestamp: timestamp(),
          from: { role: 'bot' },
          id: '3.0',
          text: `https://sharepoint.contoso.com/team/ has been added as a Knowledge source.
You can preview your extension at any time.`,
          type: 'message'
        },
        {
          timestamp: timestamp(),
          from: { role: 'user' },
          id: '4.0',
          text: '',
          channelData: {
            state: 'sent',
            attachmentSizes: [65 * 1024]
          },
          attachments: [
            {
              contentType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
              name: 'Onboarding Checklist.doc'
            }
          ],
          type: 'message'
        },
        {
          timestamp: timestamp(),
          from: { role: 'bot' },
          suggestedActions: {
            actions: [
              {
                displayText: 'What else should I say?',
                text: 'What else should I say?',
                title: 'What else should I say?',
                type: 'messageBack'
              },
            ]
          },
          entities: [
            {
              "@context": "https://schema.org",
              "@id": "cite:1",
              "@type": "Claim",
              type: "https://schema.org/Claim",
              text: "The onboarding process is crucial for new hires. It helps them understand company culture, policies, and their role. A well-structured onboarding program can significantly improve employee retention and productivity."
            }
          ],
          text: `Great! I've reviewed the Onboarding Checklist.doc[1]\u200C[2]. Here are some key points to include in your Onboarding Buddy's knowledge base:

1. Welcome package preparation[1]
2. IT setup and access provisioning[1]
3. First-day orientation schedule
4. Introduction to company policies[2]
5. Team meet-and-greet sessions[3]

[1]: https://sharepoint.contoso.com/newhires/Onboarding%20Checklist.doc
[2]: https://sharepoint.contoso.com/team/ \"Company SharePoint\"
[3]: cite:1 \"Importance of Onboarding\"
`,
          type: "message"
        }
      ], [
        {
          timestamp: timestamp(),
          entities: [
            {
              '@context': 'https://schema.org',
              '@id': '',
              '@type': 'Message',
              keywords: ['PreChatMessage'],
              type: 'https://schema.org/Message',
              author: {
                '@context': 'https://schema.org',
                '@type': 'Person',
                type: 'https://schema.org/Person',
                image: botIcon,
                description: 'Ready to explore? Select one of the suggestions below to get started...',
                name: 'Onboarding Buddy',
              }
            }
          ],
          suggestedActions: {
            actions: [
              {
                image: `data:image/svg+xml;utf8,${encodeURIComponent('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5C2 4.22386 2.22386 4 2.5 4H13.5C13.7761 4 14 4.22386 14 4.5C14 4.77614 13.7761 5 13.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM2 9.5C2 9.22386 2.22386 9 2.5 9H17.5C17.7761 9 18 9.22386 18 9.5C18 9.77614 17.7761 10 17.5 10H2.5C2.22386 10 2 9.77614 2 9.5ZM2.5 14C2.22386 14 2 14.2239 2 14.5C2 14.7761 2.22386 15 2.5 15H11.5C11.7761 15 12 14.7761 12 14.5C12 14.2239 11.7761 14 11.5 14H2.5Z" fill="#707070"/></svg>')}`,
                // fill="#999999" in dark theme
                text: 'Track new hire tasks.',
                type: 'messageBack',
                title: 'Checklist'
              },
              {
                image: `data:image/svg+xml;utf8,${encodeURIComponent('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M17.1813 2.92689C16.0291 1.71505 14.1047 1.69077 12.9222 2.87317L3.54741 12.2475C3.21958 12.5754 2.99204 12.9899 2.89148 13.4424L2.01387 17.3923C1.97678 17.5592 2.02754 17.7335 2.14844 17.8544C2.26934 17.9753 2.44362 18.026 2.6105 17.9889L6.53689 17.1157C7.00432 17.0118 7.43243 16.7767 7.77103 16.4381L17.129 7.08003C18.27 5.939 18.2933 4.09631 17.1813 2.92689ZM13.6293 3.58029C14.4143 2.79538 15.6917 2.8115 16.4566 3.61596C17.1948 4.39225 17.1793 5.61548 16.4219 6.37293L15.7507 7.04418L12.958 4.25155L13.6293 3.58029ZM12.2509 4.95864L15.0436 7.7513L7.06391 15.731C6.85976 15.9352 6.60164 16.0769 6.31982 16.1396L3.1605 16.8421L3.86768 13.6593C3.92698 13.3924 4.06117 13.148 4.2545 12.9547L12.2509 4.95864Z" fill="#707070"/></svg>')}`,
                // fill="#999999" in dark theme
                text: 'Set up your laptop',
                type: 'messageBack',
                title: 'Equipment'
              },
              {
                image: `data:image/svg+xml;utf8,${encodeURIComponent('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.49279 4.90114C8.13479 4.9711 7.7439 5.20337 7.43474 5.74712C7.29826 5.98718 6.99301 6.07114 6.75296 5.93465C6.5129 5.79817 6.42894 5.49292 6.56543 5.25287C7.00628 4.47749 7.63328 4.0502 8.30099 3.9197C8.9539 3.7921 9.60295 3.95667 10.0932 4.28126C10.5768 4.6015 10.9679 5.12423 10.9804 5.75187C10.9934 6.40602 10.5946 6.99672 9.86123 7.43036C9.36263 7.7252 9.16869 7.92513 9.08626 8.05795C9.01687 8.16975 9.00009 8.27172 9.00009 8.5C9.00009 8.77614 8.77623 9 8.50009 9C8.22394 9 8.00009 8.77614 8.00009 8.5C8.00009 8.22827 8.01399 7.88929 8.2366 7.53061C8.44617 7.19295 8.80555 6.89287 9.35222 6.5696C9.88718 6.25326 9.98416 5.95168 9.98059 5.77173C9.97649 5.56527 9.83866 5.31208 9.54108 5.11505C9.25005 4.92235 8.86559 4.82828 8.49279 4.90114ZM8.75 11.5C9.16421 11.5 9.5 11.1642 9.5 10.75C9.5 10.3358 9.16421 10 8.75 10C8.33579 10 8 10.3358 8 10.75C8 11.1642 8.33579 11.5 8.75 11.5ZM8.50019 1C4.91034 1 2.00019 3.91015 2.00019 7.5C2.00019 8.651 2.29978 9.73335 2.82544 10.6719L2.0297 12.7542C1.73642 13.5216 2.4424 14.2957 3.23352 14.0741L5.7209 13.3774C6.5641 13.7768 7.50671 14 8.50019 14C12.09 14 15.0002 11.0899 15.0002 7.5C15.0002 3.91015 12.09 1 8.50019 1ZM3.00019 7.5C3.00019 4.46243 5.46263 2 8.50019 2C11.5378 2 14.0002 4.46243 14.0002 7.5C14.0002 10.5376 11.5378 13 8.50019 13C7.59806 13 6.74803 12.7832 5.99798 12.3993L5.82377 12.3101L2.96381 13.1111L3.93292 10.5753L3.80463 10.3655C3.29438 9.53135 3.00019 8.55079 3.00019 7.5ZM11.4628 17C9.49315 17 7.72814 16.1239 6.53613 14.7402C7.09918 14.8926 7.68851 14.981 8.29584 14.9973C9.19123 15.629 10.2837 16 11.4628 16C12.3649 16 13.2149 15.7832 13.965 15.3993L14.1392 15.3101L16.9992 16.1111L16.0301 13.5752L16.1583 13.3655C16.6686 12.5313 16.9628 11.5508 16.9628 10.5C16.9628 9.34552 16.6071 8.27414 15.9993 7.38943C15.9905 6.78165 15.9095 6.19137 15.7643 5.6268C17.1125 6.81779 17.9628 8.5596 17.9628 10.5C17.9628 11.651 17.6632 12.7333 17.1375 13.6719L17.9333 15.7542C18.2266 16.5216 17.5206 17.2957 16.7295 17.0741L14.2421 16.3774C13.3989 16.7768 12.4563 17 11.4628 17Z" fill="#707070"/></svg>')}`,
                // fill="#999999" in dark theme
                text: 'Join groups and lists',
                type: 'messageBack',
                title: 'Groups'
              },
              {
                image: `data:image/svg+xml;utf8,${encodeURIComponent('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5C2 4.22386 2.22386 4 2.5 4H13.5C13.7761 4 14 4.22386 14 4.5C14 4.77614 13.7761 5 13.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM2 9.5C2 9.22386 2.22386 9 2.5 9H17.5C17.7761 9 18 9.22386 18 9.5C18 9.77614 17.7761 10 17.5 10H2.5C2.22386 10 2 9.77614 2 9.5ZM2.5 14C2.22386 14 2 14.2239 2 14.5C2 14.7761 2.22386 15 2.5 15H11.5C11.7761 15 12 14.7761 12 14.5C12 14.2239 11.7761 14 11.5 14H2.5Z" fill="#707070"/></svg>')}`,
                // fill="#999999" in dark theme
                text: 'Access team boards.',
                type: 'messageBack',
                title: 'Boards'
              },
              {
                image: `data:image/svg+xml;utf8,${encodeURIComponent('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5C2 4.22386 2.22386 4 2.5 4H13.5C13.7761 4 14 4.22386 14 4.5C14 4.77614 13.7761 5 13.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM2 9.5C2 9.22386 2.22386 9 2.5 9H17.5C17.7761 9 18 9.22386 18 9.5C18 9.77614 17.7761 10 17.5 10H2.5C2.22386 10 2 9.77614 2 9.5ZM2.5 14C2.22386 14 2 14.2239 2 14.5C2 14.7761 2.22386 15 2.5 15H11.5C11.7761 15 12 14.7761 12 14.5C12 14.2239 11.7761 14 11.5 14H2.5Z" fill="#707070"/></svg>')}`,
                // fill="#999999" in dark theme
                text: 'Meet your teammates.',
                type: 'messageBack',
                title: 'Connect'
              },
              {
                image: `data:image/svg+xml;utf8,${encodeURIComponent('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5C2 4.22386 2.22386 4 2.5 4H13.5C13.7761 4 14 4.22386 14 4.5C14 4.77614 13.7761 5 13.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM2 9.5C2 9.22386 2.22386 9 2.5 9H17.5C17.7761 9 18 9.22386 18 9.5C18 9.77614 17.7761 10 17.5 10H2.5C2.22386 10 2 9.77614 2 9.5ZM2.5 14C2.22386 14 2 14.2239 2 14.5C2 14.7761 2.22386 15 2.5 15H11.5C11.7761 15 12 14.7761 12 14.5C12 14.2239 11.7761 14 11.5 14H2.5Z" fill="#707070"/></svg>')}`,
                // fill="#999999" in dark theme
                text: 'Browse team projects.',
                type: 'messageBack',
                title: 'Projects'
              }
            ],
            to: []
          },
          type: 'message'
        }
      ], [
        {
          timestamp: timestamp(),
          from: { "role": "user" },
          id: "1.0",
          text: "Hi, I'm a new employee starting today. Can you help me with the onboarding process?",
          type: "message"
        },
        {
          timestamp: timestamp(),
          from: { role: 'bot' },
          entities: [aiMessageEntity],
          id: "1.1",
          text: "Welcome to the team! \n\n I'd be happy to assist you with your onboarding. Let's start with the essentials. Have you received your welcome package yet?",
          type: "message",
          textFormat: "plain"
        },
        {
          timestamp: timestamp(),
          from: { "role": "user" },
          id: "2.0",
          text: "Yes, I got it this morning.",
          type: "message"
        },
        {
          timestamp: timestamp(),
          from: { role: 'bot' },
          entities: [aiMessageEntity],
          id: "2.1",
          text: `Great! Let's go through the next steps:

1. IT Setup: Have you received your company laptop and login credentials?
2. First-day orientation: I can provide you with today's schedule.
3. Company policies: I can guide you through the most important ones.
4. Team introductions: Would you like me to arrange meet-and-greets with your colleagues?

Which of these would you like to start with?`,
          type: "message"
        },
        {
          timestamp: timestamp(),
          from: { "role": "user" },
          id: "3.0",
          text: "I have my laptop, but I'm not sure about my login credentials. Can you help with that?",
          type: "message"
        },
        {
          timestamp: timestamp(),
          from: { role: 'bot' },
          entities: [aiMessageEntity],
          id: "3.1",
          text: `Of course! Your login credentials should have been emailed to your personal email address. If you haven't received them, I can help you contact our IT support team.

Here's what you need to do:

1. Check your personal email inbox and spam folder for an email from it-support@contoso.com
2. If you can't find the email, I can generate a support ticket for you right away.

Would you like me to create a support ticket?`,
          type: "message"
        },
        {
          timestamp: timestamp(),
          from: { "role": "user" },
          id: "4.0",
          text: "I found the email, thanks! What's next on the checklist?",
          type: "message"
        },
        {
          timestamp: timestamp(),
          from: { role: 'bot' },
          entities: [aiMessageEntity],
          id: "4.1",
          text: `Excellent! I'm glad you found your credentials. The next item on our onboarding checklist is your first-day orientation. Here's your schedule for today:

9:00 AM - Welcome meeting with HR
10:00 AM - Company overview presentation
11:30 AM - Tour of the office
1:00 PM - Lunch with your team
2:30 PM - IT systems training
4:00 PM - Meet with your direct supervisor

Is there anything on this schedule you'd like more information about?`,
          type: "message"
        },
        {
          timestamp: timestamp(),
          from: { "role": "user" },
          id: "5.0",
          text: "This is helpful, thanks! Can you tell me more about the company policies I need to know?",
          type: "message"
        },
        {
          timestamp: timestamp(),
          from: { role: 'bot' },
          entities: [aiMessageEntity],
          id: "5.1",
          text: `Certainly! Here are the key company policies you should be aware of:

1. Code of Conduct: Outlines expected behavior and ethical standards.
2. IT Usage Policy: Guidelines for using company computers and networks.
3. Confidentiality Agreement: Explains how to handle sensitive information.
4. Time Off and Leave Policy: Details vacation, sick days, and other leave types.
5. Remote Work Policy: Explains our hybrid work model and expectations.

You can find detailed information on all these policies in the Employee Handbook, which is available at:

[Employee Handbook](https://sharepoint.contoso.com/newhires/EmployeeHandbook.pdf)

Would you like me to summarize any specific policy for you?`,
          type: "message"
        },
        {
          timestamp: timestamp(),
          from: { "role": "user" },
          id: "6.0",
          text: "The Remote Work Policy sounds interesting. Can you give me a quick overview?",
          type: "message"
        },
        {
          timestamp: timestamp(),
          from: { role: 'bot' },
          entities: [aiMessageEntity],
          id: "6.1",
          text: `Certainly! Here's a brief overview of our Remote Work Policy:

1. Hybrid Model: We operate on a 3-2 model (3 days in office, 2 days remote per week).
2. Core Hours: All employees should be available online from 10 AM to 3 PM, regardless of location.
3. Equipment: The company provides necessary equipment for home offices.
4. Security: VPN must be used when accessing company resources remotely.
5. Communication: Teams is our primary platform for remote collaboration.
6. Productivity: Regular check-ins with supervisors to ensure work progress.

Remember, this is just a summary. For full details, please refer to the Employee Handbook.

Is there anything specific about the Remote Work Policy you'd like to know more about?`,
          type: "message"
        },
        {
          timestamp: timestamp(),
          from: { "role": "user" },
          id: "7.0",
          text: "That's great, thanks! I think I'm all set for now. Is there anything else I should know for my first day?",
          type: "message"
        },
        {
          timestamp: timestamp(),
          from: { role: 'bot' },
          entities: [
            aiMessageEntity,
            {
              "@context": "https://schema.org",
              "@id": "cite:1",
              "@type": "Claim",
              type: "https://schema.org/Claim",
              text: "The onboarding process is crucial for new hires. It helps them understand company culture, policies, and their role. A well-structured onboarding program can significantly improve employee retention and productivity."
            }
          ],
          suggestedActions: {
            actions: [
              {
                displayText: 'Tell me more about onboarding process',
                text: 'Tell me more about onboarding process',
                title: 'Tell me more about onboarding process',
                type: 'messageBack'
              }
            ]
          },
          id: "7.1",
          text: `I'm glad I could help! For your first day, here are some tips[1]:

1. Dress Code: Business casual dress code[2].
2. Lunch: The cafeteria is on the 2nd floor[3], or you can join your team for lunch as scheduled.
3. Building Access: Your employee badge will be provided during your welcome meeting with HR[4].
4. Questions: Don't hesitate to ask questions - everyone is here to help you succeed[5]!
5. Parking: Park in the 'New Employee' spots first week[6]\u200C[7].

Otherwise parking permit is required[7].

[1]: https://sharepoint.contoso.com/newhires/FirstDayTips.pdf \"Contoso First Day Tips\"
[2]: https://sharepoint.contoso.com/hr/DressCodePolicy.pdf \"Contoso Dress Code Policy\"
[3]: https://sharepoint.contoso.com/facilities/CafeteriaMenu.pdf \"Contoso Cafeteria Information and Weekly Menu\"
[4]: https://sharepoint.contoso.com/security/BadgeAccessGuide.pdf \"Contoso Building Access and Badge Information\"
[5]: https://sharepoint.contoso.com/hr/NewHireFAQ.pdf \"Frequently Asked Questions for New Hires\"
[6]: https://sharepoint.contoso.com/facilities/ParkingMap.pdf \"Contoso Office Parking Map\"
[7]: cite:1 \"Meet the Contoso Team\"`,
          type: "message"
        }
      ], [
        {
          timestamp: timestamp(),
          from: { "role": "user" },
          id: "6.0",
          text: "Help me access my team’s sprint board?",
          type: "message"
        },
        {
          timestamp: timestamp(),
          from: { role: 'bot' },
          entities: [aiMessageEntity],
          id: "7.1",
          text: `To access your team's sprint board, you can follow these steps:

Check if you have the necessary permissions to access the sprint board. You might need to be part of a specific security group or have a particular role assigned to you.
1. If you're unsure about your access rights or need to request access, you can reach out to your team.
2. Once you have access, you can navigate to the board through the Azure DevOps portal. Look for the board under the 'Boards' tab in your project's dashboard.

If your access is still pending, consider emailing your manager to remind them to give you access.`,
          type: "message"
        },
        {
          timestamp: timestamp(),
          from: { role: 'channel' },
          text: `Extension refreshed`,
          type: 'message'
        }
      ], [
        {
          timestamp: timestamp(),
          from: { "role": "user" },
          id: "6.0",
          text: "Start onboarding",
          type: "message"
        },
        {
          timestamp: timestamp(),
          from: { role: 'bot' },
          entities: [{
            ...aiMessageEntity,
            keywords: []
          }],
          id: "a4c0c01d-c06e-4dde-9278-265c607b545b",
          type: "typing",
          text: "Processing your request…",
          channelData: {
            streamType: "informative",
            streamSequence: 1
          }
        },
        {
          timestamp: timestamp(),
          from: { role: 'bot' },
          entities: [aiMessageEntity],
          id: "a4c0c01d-c06e-4dde-9278-265c607b545b-89",
          type: "typing",
          text: "Hello there! I'm your Onboarding Buddy, here to guide you through your first days at our company. Let's go over some important information:\n\n- Your **orientation session** is scheduled for tomorrow at **9:00 AM** in the main conference room.",
          channelData: {
            streamType: "streaming",
            streamId: "a4c0c01d-c06e-4dde-9278-265c607b545b",
            streamSequence: 90
          }
        },
        {
          timestamp: timestamp(),
          from: { role: 'bot' },
          entities: [aiMessageEntity],
          id: "a4c0c01d-c06e-4dde-9278-265c607b545b-82",
          type: "message",
          text: "Hello there! I'm your Onboarding Buddy, here to guide you through your first days at our company. Let's go over some important information:\n\n- Your **orientation session** is scheduled for tomorrow at **9:00 AM** in the main conference room.\n\n- Don't forget to complete your **new hire paperwork** by the end of this week. This includes your tax forms, benefits enrollment, and emergency contact information.\n\nGood luck!",
          channelData: {
            streamType: "final",
            streamId: "a4c0c01d-c06e-4dde-9278-265c607b545b",
            streamSequence: 99
          }
        },
        {
          timestamp: timestamp(),
          from: { role: 'bot' },
          entities: [aiMessageEntity],
          id: "a4c0c01d-c06e-4dde-9278-265c607b549c",
          type: "message",
          text: "Let me know if I can help with anything else.",
        }
      ], [
        {
          timestamp: timestamp(),
          from: { "role": "user" },
          id: "6.0",
          text: `Help me to create a beautiful visualization of harmonic waves using Python, complete the following code:
\`\`\`python
def plot_sine_waves():
    t = np.linspace(0, 10, 1000)
\`\`\``,
          type: "message"
        },
        {
          timestamp: timestamp(),
          from: { role: 'bot' },
          entities: [{
            ...aiMessageEntity,
            isBasedOn: {
              '@type': 'SoftwareSourceCode',
              'programmingLanguage': 'python',
              "text": `import numpy as np
import matplotlib.pyplot as plt

def plot_sine_waves():
    """Create a beautiful visualization of sine waves with different frequencies."""
    # Generate time points
    t = np.linspace(0, 10, 1000)

    # Create waves with different frequencies and phases
    wave1 = np.sin(t)
    wave2 = 0.5 * np.sin(2 * t + np.pi/4)
    wave3 = 0.3 * np.sin(3 * t + np.pi/3)

    # Combine waves
    combined = wave1 + wave2 + wave3

    # Create a stylish plot
    plt.style.use('seaborn-darkgrid')
    plt.figure(figsize=(12, 8))

    # Plot individual waves
    plt.plot(t, wave1, label='Primary Wave', alpha=0.5)
    plt.plot(t, wave2, label='Second Harmonic', alpha=0.5)
    plt.plot(t, wave3, label='Third Harmonic', alpha=0.5)

    # Plot combined wave with a thicker line
    plt.plot(t, combined, 'r-',
            label='Combined Wave',
            linewidth=2)

    plt.title('Harmonic Wave Composition', fontsize=14)
    plt.xlabel('Time', fontsize=12)
    plt.ylabel('Amplitude', fontsize=12)
    plt.legend()
    plt.grid(True, alpha=0.3)

    # Show the plot
    plt.tight_layout()
    plt.show()

# Generate the visualization
plot_sine_waves()`
            }
          }],
          id: "a4c0c01d-c06e-4dde-9278-265c607b545b-82",
          type: "message",
          text: `This example demonstrates creating a visualization of harmonic waves using Python's Matplotlib library. The code generates three sine waves with different frequencies and phases, then combines them to show wave interference patterns.
<img alt="wave plot" src="${waveSvg}">

Use the command to install required dependencies:

    $ pip install numpy matplotlib`
        }
      ], [
        {
          from: {
            role: "bot"
          },
          id: "a-00000",
          type: "message",
          text: "This is compleded feedback action example.",
          timestamp: timestamp(),
          entities: [
            {
              ...aiMessageEntity,
              keywords: ['AIGeneratedContent', 'AllowCopy'],
              potentialAction: [
                {
                  "@type": "LikeAction",
                  actionStatus: "CompletedActionStatus",
                  target: {
                    "@type": "EntryPoint",
                    urlTemplate: "ms-directline://postback?interaction=like"
                  }
                },
                {
                  "@type": "DislikeAction",
                  actionStatus: "PotentialActionStatus",
                  result: {
                    "@type": "Review",
                    reviewBody: "I don't like it.",
                    "reviewBody-input": {
                      "@type": "PropertyValueSpecification",
                      valueMinLength: 3,
                      valueName: "reason"
                    }
                  },
                  target: {
                    "@type": "EntryPoint",
                    urlTemplate: "ms-directline://postback?interaction=dislike{&reason}"
                  }
                }
              ]
            }
          ]
        },
        {
          from: {
            role: "bot"
          },
          id: "a-00001",
          type: "message",
          text: "Hi! I'm Cody, the devbot. How can I help?",
          timestamp: timestamp(),
          entities: [
            {
              ...aiMessageEntity,
              keywords: ['AIGeneratedContent', 'AllowCopy'],
              potentialAction: [
                {
                  "@type": "LikeAction",
                  actionStatus: "PotentialActionStatus",
                  target: {
                    "@type": "EntryPoint",
                    urlTemplate: "ms-directline://postback?interaction=like"
                  }
                },
                {
                  "@type": "DislikeAction",
                  actionStatus: "PotentialActionStatus",
                  result: {
                    "@type": "Review",
                    reviewBody: "I don't like it.",
                    "reviewBody-input": {
                      "@type": "PropertyValueSpecification",
                      valueMinLength: 3,
                      valueName: "reason"
                    }
                  },
                  target: {
                    "@type": "EntryPoint",
                    urlTemplate: "ms-directline://postback?interaction=dislike{&reason}"
                  }
                }
              ]
            }
          ]
        }
      ]];

      const leftStore = testHelpers.createStore();
      const leftDirectLine = await testHelpers.createDirectLineWithTranscript(transcripts.at(leftTranscriptIndex));

      const rightStore = testHelpers.createStore();
      const rightDirectLine = await testHelpers.createDirectLineWithTranscript(transcripts.at(rightTranscriptIndex));


      const root = createRoot(document.getElementById('webchat'));

      const customBrandRamp = {
        '10': '#12174c',
        '20': '#1a1f5b',
        '30': '#21276a',
        '40': '#293079',
        '50': '#303788',
        '60': '#384097',
        '70': '#4049a7',
        '80': '#151e80',
        '90': '#4f59c5',
        '100': '#5661d4',
        '110': '#5e69e3',
        '120': '#7982e8',
        '130': '#949bec',
        '140': '#afb5f1',
        '150': '#c9cdf6',
        '160': '#e4e6fa'
      };

      const App = () => {
        const theme = searchParams.get('theme');
        const isDarkTheme = theme === 'fluent-dark';

        const fluentProviderTheme = isDarkTheme ? {
          ...createDarkTheme(customBrandRamp),
          colorNeutralBackground1Disabled: '#101010',
          colorNeutralBackground1Hover: '#101010',
          colorNeutralForeground5: '#424242'
        } : undefined;

        return React.createElement(FluentProvider, {
          className: `theme-provider ${isDarkTheme ? 'dark' : 'light'}`,
          theme: fluentProviderTheme
        },
          React.createElement('div', { className: "webchat-left" },
            React.createElement(FluentThemeProvider, { variant: leftVariant },
              React.createElement(ReactWebChat, {
                directLine: leftDirectLine,
                store: leftStore,
                overrideLocalizedStrings: {
                  TEXT_INPUT_PLACEHOLDER: 'Describe how your copilot should behave'
                },
                styleOptions: {
                  maxMessageLength: null,
                  ...adjustStyleOptions
                }
              })
            )
          ),
          React.createElement('div', { className: "webchat-right" },
            React.createElement(FluentThemeProvider, { variant: rightVariant },
              React.createElement(ReactWebChat, {
                directLine: rightDirectLine,
                store: rightStore,
                overrideLocalizedStrings: {
                  TEXT_INPUT_PLACEHOLDER: 'Ask a work question or use / to reference people, files and more',
                  ACTIVITY_CODE_CAUTION: 'AI-generated code. Review and use carefully. [More info on FAQ](https://aka.ms/AIandCopilotFAQs).'
                },
                styleOptions: {
                  groupTimestamp: 1,
                  timestampFormat: 'absolute',
                  botAvatarBackgroundColor: '#304E7A',
                  ...adjustStyleOptions
                }
              })
            )
          )
        );
      }

      flushSync(() =>
        root.render(
          React.createElement(App)
        )
      );

      await pageConditions.scrollStabilized();

      await host.snapshot('local');

      const focusPresetsMap = new Map(Object.entries({
        navigation: async sendbox => {
          sendbox.focus();
          await host.sendKeys('Next message');
          await host.snapshot('local');
          await host.sendKeys('ENTER');
          // hide timestamp to not fail snapshot if is not relative
          sendbox.parentElement.parentElement.parentElement.parentElement.querySelector('.part-grouping-decorator:last-child .stacked-layout__status').style.opacity = 0;
          await host.snapshot('local');
          await host.sendShiftTab();
          await host.snapshot('local');
          await host.sendKeys('HOME');
          await host.snapshot('local');
          await host.sendKeys('END');
          await host.snapshot('local');
          await host.sendKeys('ARROW_UP');
          await host.snapshot('local');
          await host.sendKeys('ENTER');
          await host.sendShiftTab();
          await host.snapshot('local');
          await host.sendKeys('ENTER');
          await host.snapshot('local');
          await host.sendKeys('ESCAPE');
        },
        viewCode: async sendbox => {
          sendbox.focus();
          await host.sendShiftTab();
          await host.sendKeys('ARROW_UP');
          await host.sendKeys('ENTER');
          await host.snapshot('local');
          await host.sendKeys('TAB');
          await host.snapshot('local');
          await host.sendKeys('ENTER');
          await host.snapshot('local');
          await host.sendKeys('ENTER');
          await host.snapshot('local');
        },
        likeDislike: async sendbox => {
          sendbox.focus();
          await host.sendShiftTab();
          await host.sendKeys('ARROW_UP');
          await host.sendKeys('ENTER');
          await host.snapshot('local');
          await host.sendKeys('TAB');
          await host.snapshot('local');
          await host.sendKeys('SPACE');
          await host.snapshot('local');
          await host.sendKeys('TAB');
          await host.snapshot('local');
          await host.sendKeys('SPACE');
          await host.snapshot('local');
          await host.sendKeys('SPACE'); // Clear feedback but still focused on feedback button
          await host.sendKeys('ESCAPE'); // Focus on activity
          await host.sendKeys('ESCAPE'); // Clear activity selection
          await host.snapshot('local');
        }
      }));

      const sendboxes = Array.from(document.querySelectorAll(`[data-testid="${WebChat.testIds.sendBoxTextBox}"]`))
        .filter((_, index) => sendBoxIndexes.includes(String(index)));

      const focusPresets = activeFocusPresets
        .map(presetName => focusPresetsMap.get(presetName))
        .filter(preset => preset)

      if (!focusPresets.length) focusPresets.push(focusPresetsMap.get('navigation'));

      for (const preset of focusPresets) {
        for (const sendbox of sendboxes) {
          await preset(sendbox)
        }
      }
    }, { skipCheckAccessibility: true });

    window.checkAccessibility = async () => {}
  </script>
</body>

</html>
